﻿using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using ControleRepresentante.Logic.Models;
using Telerik.Web.Mvc.UI.Fluent;

namespace WebSite.ViewModels.DetailsViewModels.DetailsGridViewModels
{
    public class UsuarioDetailsGridViewModel : DetailsGridViewModel<User>
    {
        public UsuarioDetailsGridViewModel(HtmlHelper htmlHelper, IEnumerable<User> users)
            : base(htmlHelper, "User", users)
        {
        }

        protected override void Columns(GridColumnFactory<User> configurator)
        {
            configurator.Bound(x => x.Username)
                .Template(x => HtmlHelper.ActionLink(x.Username, "Details", "Usuario", new { id = x.Id }, new { }));
            configurator.Bound(x => x.Email);
            configurator.Bound(x => x.Ativo);
        }
    }
}